package widget;

import android.annotation.TargetApi;
import android.content.Context;
import android.os.Build;
import android.transition.ChangeBounds;
import android.transition.ChangeImageTransform;
import android.transition.ChangeTransform;
import android.transition.TransitionSet;
import android.util.AttributeSet;

/**
 * Created by WLH on 2016/11/28.
 * 转换动画
 */
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
public class DetialTransition extends TransitionSet {
    public DetialTransition(){
        init();
    }

    /**
     * 允许资源文件的使用
     * @param context
     * @param attrs
     */
    public DetialTransition(Context context, AttributeSet attrs){
        super(context,attrs);
        init();
    }

    private void init() {
        setOrdering(ORDERING_TOGETHER);
        addTransition(new ChangeBounds())
                .addTransition(new ChangeTransform())
                .addTransition(new ChangeImageTransform());
    }
}
